package org.yelongframework.excel.workbook;

import java.util.Objects;

import org.yelongframework.excel.sheet.ExcelSheet;

/**
 * 抽象实现
 * 
 * @since 1.0.0
 */
public abstract class AbstractExcelWorkbook implements ExcelWorkbook {

	/** 工作薄 */
	private final Object workbook;

	// ==================================================构造器==================================================

	/**
	 * @param workbook 工作薄对象
	 */
	public AbstractExcelWorkbook(Object workbook) {
		this.workbook = Objects.requireNonNull(workbook, "workbook");
	}

	// ==================================================获取工作表==================================================

	@Override
	public ExcelSheet getFirstSheet() {
		return getSheet(0);
	}

	// ==================================================工作薄==================================================

	@Override
	public Object getWorkbook() {
		return workbook;
	}

}
